package de.koller.reason.gameGui.listener;

import de.koller.oceanFramework.gl.OceanGame;
import de.koller.oceanFramework.tree.ISea3;
import de.koller.reason.gui.component.button.ButtonEvent;
import de.koller.reason.gui.component.button.ButtonStatus;
import de.koller.reason.gui.component.button.IButtonListener;

public class ExitListener implements IButtonListener {

	private final ISea3 root;
	
	public ExitListener( ISea3 root ) {
		this.root = root;
	}
	
	@Override
	public void eventOccured( ButtonEvent event ) {
		if( event.buttonStatus == ButtonStatus.MouseReleased )
			((OceanGame)root.getGame()).stopRunning();
	}
	
}
